<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
	<head>
		<title>微商后台管理系统-权限列表</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
		<link rel="icon" type="image/ico" href="/assets/images/favicon.ico" />
		<object th:remove="tag" th:include="admin/include/css-header :: css-header"></object>
		<object th:remove="tag" th:include="admin/include/js-header :: js-header"></object>
		<!-- DataTabel --> 	
	    <link rel="stylesheet" href="/assets/js/vendor/chosen/css/chosen.min.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/chosen/css/chosen-bootstrap.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/datatables/css/dataTables.bootstrap.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/datatables/css/ColVis.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/datatables/css/TableTools.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/chosen/css/chosen.min.css"/>
	    <link rel="stylesheet" href="/assets/js/vendor/chosen/css/chosen-bootstrap.css"/>
	</head>
	<body class="bg-3">
    <!-- 遮罩 -->
    <div class="mask"><div id="loader"></div></div>
    <!--/遮罩 -->
    <!-- 主体内容  -->
    <div id="wrap">
      <div class="row">
       <!-- 头部 和 左侧菜单 -->
		<object th:remove="tag" th:include="admin/include/header :: header"></object>
        <!-- /头部 和 左侧菜单 -->
        <!-- 中间内容 -->
        <div id="content" class="col-md-12">
          <!-- 中间内容头部 -->
          <div class="pageheader">
            <h2><i class="fa fa-lightbulb-o" style="line-height: 48px;padding-left: 0;"></i> 添加权限  <span></span></h2>
            <div class="breadcrumbs">
              <ol class="breadcrumb">
                <li><a href="/admin">首页</a></li>
                <li><a href="/admin/role">角色列表</a></li>
                <li>添加角色</li>
              </ol>
            </div>
          </div>
          <!-- /中间内容头部 -->
          <!-- 中间内容主体 -->
          <div class="main">
            <div class="row">
              <div class="col-md-11">
                <!-- tile -->
                <section class="tile color transparent-black">
                  <!-- tile header -->
                  <div class="tile-header">
                    <h1><strong>创建表单</strong></h1>
                    <div class="controls">
                      <a href="javascirpt:void(0)" class="minimize"><i class="fa fa-chevron-down"></i></a>
                      <a href="javascirpt:void(0)" class="refresh"><i class="fa fa-refresh"></i></a>
                      <a href="javascirpt:void(0)" class="remove"><i class="fa fa-times"></i></a>
                    </div>
                  </div>
                  <!-- /tile header -->
                  <!-- tile body -->
                  <div class="tile-body">
                    <form class="form-horizontal" role="form" id="addForm"  action="/admin/role/add"  method="post" >
                      <div class="form-group">
                        <label for="name" class="col-sm-4 control-label">角色名称*</label>
                        <div class="col-sm-8">
                          <input type="text" class="form-control" id="name" name="name"/>
                        </div>
                      </div>
                      
                      <div class="form-group">
                        <label for="remark" class="col-sm-4 control-label">角色备注</label>
                        <div class="col-sm-8">
                          <input type="text" class="form-control" name="remark" id="remark"/>
                        </div>
                      </div>
                      
                      <div class="form-group ">
                          <label for="enabled" class="col-sm-4 control-label">是否启用</label>
                          <div class="col-sm-8 checkbox check-transparent">
                        		<input type="checkbox" id="enabled" name="enabled" />
                        		<label for="enabled">是否启用</label>
                          </div>
                      </div>
                      
                      <div class="form-group">
                        <label for="permissions" class="col-sm-4 control-label">权限详情</label>
                        <div class="col-sm-8" id="selectbox2">
                          <select multiple=""  class="chosen-select chosen-transparent form-control" name="permissions" id="permissions">
	                          <optgroup th:remove="tag" th:each="permission,iterStat:${permissions}">
	                           <option th:value="${permission.id}" th:text="${permission.permissionname}"></option>
	                          </optgroup>
                          </select>
                        </div>
                      </div>
                      
                      <div class="form-group form-footer">
                        <div class="text-center">
                          <button type="submit" class="btn btn-primary" style="width:150px;">添加</button>
                          <button type="reset" class="btn btn-red"  style="width:150px;">重置</button>
                        </div>
                      </div>
                    </form>
                  </div>
                  <!-- /tile body -->
                  </section>
              </div>
            </div>
          </div>
  	    <!-- /中间内容主体 -->
        </div>
        <!-- /中间内容 -->
      </div>
    </div>
	<!-- /主体内容  -->
	<object th:remove="tag"
		th:include="admin/include/js-footer :: js-footer"></object>
	<object th:remove="tag"
		th:include="admin/include/flashMessage :: flashMessage"></object>
	
	<script type="text/javascript" src="/lib/validate/jquery.validate.min.js"></script>
	<script src="/assets/js/vendor/chosen/chosen.jquery.min.js"></script>
	<script src="/admin/js/role/add.js"></script>
	<script>
	    $(function(){
	      //chosen select input
	      $(".chosen-select").chosen({disable_search_threshold: 10});
	    })
    </script>
  </body>
	
</html>